//
//  DownloadModel.m
//  MXClassroom
//
//  Created by 你个LB on 16/9/11.
//  Copyright © 2016年 你个LB. All rights reserved.
//

#import "DownloadModel.h"

@implementation DownloadModel

// 自定义初始化方法
- (id)initWithContentDic:(NSDictionary *)dic{
    self = [super initWithContentDic:dic];
    if (self) {
        NSString * downloadStateStr = [dic objectForKey:@"downloadState"];
        if ([downloadStateStr  isEqual: @"WaitDownload"]) {
            // 等待下载状态
            self.downloadState = WaitDownload;
        } else if ([downloadStateStr  isEqual: @"Downloading"]){
            // 正在下载状态
            self.downloadState = Downloading;
        } else{
            // 下载完成状态
            self.downloadState = Downloaded;
        }
        
        self.fileSize = [[dic objectForKey:@"fileSize"] floatValue];
        self.downloadProgress = [[dic objectForKey:@"downloadProgress"] floatValue];
    }
    return self;
}

@end
